﻿@using S4sme.Web.Resources;
@using S4sme.Web.Infrastructure.Globalisation;
@using S4sme.Core.Configuration;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>@ViewBag.Title</title>
  <meta name="title" content="@ViewBag.Title" />
  <meta content="@Resource_Common.SiteDescription" name="Description" />
  <meta content="@Resource_Common.SiteKeyWords" name="Keywords" />
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  <meta content="Global" name="Distribution" />
  <meta content="@Resource_Common.SiteAuthor" name="Author" />
  <link href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css" rel="stylesheet" type="text/css" />
  <link href="@Url.Content("~/Themes/" + Settings.CurrentTheme + "/Content/css/main.css")" rel="stylesheet" type="text/css" />
  <link rel="icon" href="@Url.Content("~/favicon.ico")" />
</head>
<body>
  <div id="page" class="pageblogbg">
    <div id="wrapper" class="wrap">      
      <div id="header">
        <div id="lang">
          <a href="@Url.GlobalisedRouteUrl("ru", ViewContext.RouteData, ViewContext.HttpContext.Request.QueryString)" title="@Resource_Common.LangRu">
                    <img alt="ru" src="@Url.Content("~/Themes/" + Settings.CurrentTheme + "/content/img/ru.gif")" />
                 </a>&nbsp; 
                 <a href="@Url.GlobalisedRouteUrl("en", ViewContext.RouteData, ViewContext.HttpContext.Request.QueryString)" title="@Resource_Common.LangEn">
                    <img alt="en" src="@Url.Content("~/Themes/" + Settings.CurrentTheme + "/content/img/gb.gif")" />
                 </a>
        </div>
        <div id="nav">
          <span id="logo">
            <img alt="logo" src="@Url.Content("~/Themes/" + Settings.CurrentTheme + "/content/img/logo_03.gif")" /></span>
          <ul>
             <li>
               @Html.ActionLink(Resource_Common.MainNavHome, "Index", "Home", new { area = "" }, new { id = "current" })
             </li>
             <li>
             @Html.ActionLink(Resource_Common.MainNavBlog, "Index", "Posts", new { area = "Blog" }, null)
             </li>
          </ul>
          
        </div>
      </div>
      
      @RenderBody()
      
      <!-- Footer -->
      <div id="wrapperfooter">
        <div id="footerblog">
          <div id="footercontent">
            <p>
              S4SME.com &copy;
                            @Resource_Common.Сopyright&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 
              <span>@Html.ActionLink(Resource_Common.MainNavContact, "Contact", "Home", new { area = "" }, null)
              @*&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 
              @Html.ActionLink(Resource_Common.MainNavAbout, "About", "Home", new { area = "" })*@
              </span></p>
              <br />
              <p class="horAd">
              <script type="text/javascript"><!--
                  google_ad_client = "pub-9186582526578916";
                  /* 468x60, created 5/3/10 */
                  google_ad_slot = "2642369506";
                  google_ad_width = 468;
                  google_ad_height = 60;
                //-->
                </script>
                <script type="text/javascript"
                src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                </script>
                </p>
          </div>
        </div>
      </div>

      <div id="staticmain" class="static">
        <div id="searchcntrl">
          <img alt="search" src="@Url.Content("~/Themes/" + Settings.CurrentTheme + "/content/img/search.gif")" /><span>@Resource_Common.SearchSite</span><br />
          <p id="searchinput">
            <input id="searchinputcntrl" type="text" onkeyup="if (this.value) {searchwords(this.value)} else {clearresults()}" /></p>
          <small>@Resource_Common.SearchNote</small>
        </div>
        <div id="blognews">
          <div id="blognewstitle">
            @Resource_Blog.BlogPostsTitle
          </div>
          <div id="blognewscontent">
          </div>
        </div>
        <div class="blogpostitem">
        <script type="text/javascript"><!--
            google_ad_client = "pub-9186582526578916";
            google_ad_slot = "9069567704";
            google_ad_width = 200;
            google_ad_height = 90;
          //-->
          </script>
          <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
          </script>
        </div>
      </div>
    </div>
  </div>

  <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.js" type="text/javascript"></script>
  @*<script type="text/javascript" src="/content/js/utils.js"></script>
  <script type="text/javascript" src="/content/js/jquery.highlight-3.yui.js"></script>*@
  <script type="text/javascript">
      var formatDate = function (formatDate, formatString) {
          if (formatDate instanceof Date) {
              var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
              var yyyy = formatDate.getFullYear();
              var yy = yyyy.toString().substring(2);
              var m = formatDate.getMonth();
              var mm = m < 10 ? "0" + m : m;
              var mmm = months[m];
              var d = formatDate.getDate();
              var dd = d < 10 ? "0" + d : d;

              var h = formatDate.getHours();
              var hh = h < 10 ? "0" + h : h;
              var n = formatDate.getMinutes();
              var nn = n < 10 ? "0" + n : n;
              var s = formatDate.getSeconds();
              var ss = s < 10 ? "0" + s : s;

              formatString = formatString.replace(/yyyy/i, yyyy);
              formatString = formatString.replace(/yy/i, yy);
              formatString = formatString.replace(/mmm/i, mmm);
              formatString = formatString.replace(/mm/i, mm);
              formatString = formatString.replace(/m/i, m);
              formatString = formatString.replace(/dd/i, dd);
              formatString = formatString.replace(/d/i, d);
              formatString = formatString.replace(/hh/i, hh);
              formatString = formatString.replace(/h/i, h);
              formatString = formatString.replace(/nn/i, nn);
              formatString = formatString.replace(/n/i, n);
              formatString = formatString.replace(/ss/i, ss);
              formatString = formatString.replace(/s/i, s);

              return formatString;
          } else {
              return "";
          }
      }

      $(document).ready(function () {
          $.getJSON("/Blog/Posts/MostRecentPosts", null, function (data) {
              var summary = "";
              $.each(data, function (i, post) {
                  var url = "/Blog/Post/" + post.Slug;
                  var date = new Date(parseInt(post.CreatedDate.replace("/Date(", "").replace(")/", ""), 10));
                  summary += '<div class="blogpostitem"><h4 class="blogposttitle"><a href="' +
                	url + '">' + post.Title + '</a></h4>';
                  summary += '<p class="blogpostbody">' +
                	post.Description + '...<span class="readmore"><a href="';
                  summary += url + '">Read more</a></span></p>';
                  summary += '<div class="blogendpost"><p class="date">Posted on ' +
                	formatDate(date, "d MMM yyyy") + '</p></div></div>';
              });
              summary += '<p class="morelink" style="text-align: right"><a href="@Url.Action("Index","Posts", new {area="Blog"})">More&gt;&gt;&gt;</a></p>';
              $("#blognewscontent").html(summary);
          });          

          /*$('#searchinputcntrl').focus();

          var resultset = "";
          if (document.getElementById('searchinputcntrl').value) {
          searchwords(document.getElementById('searchinputcntrl').value);
          }

          $("#contactsubmit").submit(function () {
          $(this).removeClass("btnsubmit");
          $(this).addClass("buttonSubmitHide");
          return true;
          });

          qsParm = getQueryStringArgs();
          if (qsParm["srch"] != undefined)
          $('#maincnt').highlight(qsParm["srch"]);
          */

          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-30206085-1']);
          _gaq.push(['_trackPageview']);

          (function () {
              var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
              ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
              var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
          })();
      });
  </script>
</body>
</html>

